package com.gopay.scheduler.dao.qulifications.impl;

import com.gopay.common.base.dao.impl.BaseReadDAOImpl;
import com.gopay.scheduler.dao.qulifications.MessageSendReadDao;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CLASSNAME:MessageSendReadDaoImpl
 * Description:邮件发送信息查询实现类
 * DATE:2017/5/8/008
 * AUTHER:PANSHICHAO
 * www.gopay.com.cn Inc.All rights reserved.
 */
@Component("messageSendReadDao")
public class MessageSendReadDaoImpl extends BaseReadDAOImpl<Object[],String> implements MessageSendReadDao {
    @Override
    public List<Object[]> getSendMailDateInfo(String email) {
        String sql = "SELECT SEND_DATE,RECEIVERS FROM MAIL_SEND_ATTACHMENT where RECEIVERS= :receiver and template = 'rcQulificationInfoNotify' and STATUS='1' order by SEND_DATE desc";
        Map<String,Object> param = new HashMap<String,Object>();

        param.put("receiver",email);

        List<Object[]> resultList = super.findBySql(sql,param);
        if(resultList == null){
            return null;
        }else{
            return resultList;
        }
    }
}
